import request from '@/utils/request'

// 附件上传
export function fileUpload(data, category) {
  return request({
    url: '/sys/file/upload/' + category,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 附件详情查询
export function selectFileById(fileIds) {
  const data = {
    'fileIds': fileIds
  }
  return request({
    url: '/sys/file/detail',
    method: 'post',
    params: data
  })
}
// 附件下载
export function fileDownLoad(obj) {
  return request({
    url: '/file/download/' + obj,
    method: 'get',
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8' // 后端ssm框架接收json类型
    }
  })
}
// ---wt(加/sys)
export function delFile(fileId) {
  const data = {
    'ids': fileId
  }
  return request({
    url: '/sys/file/remove',
    method: 'post',
    params: data
  })
}
